package me.pearl.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @author allenlee
 */
@Component
@EnableScheduling
@Slf4j
public class CronJob {

    @Scheduled(cron = "*/30 * * * * ?")
    public void doJob() {
        log.debug("===================================================");
        log.debug("<<<<< D Started: [{}] >>>>>", LocalDateTime.now());
        log.warn("<<<<< W Started: [{}] >>>>>", LocalDateTime.now());
        log.info("<<<<< I Started: [{}] >>>>>", LocalDateTime.now());
        log.error("<<<<< E Started: [{}] >>>>>", LocalDateTime.now());
    }
}
